/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.mzk.kramerius.fedoraaccess.mediaShelf;

import com.yourmediashelf.fedora.client.FedoraClient;
import com.yourmediashelf.fedora.client.FedoraCredentials;
import cz.mzk.kramerius.commons.DatastreamId;
import cz.mzk.kramerius.fedoraaccess.FedoraConnector;
import cz.mzk.kramerius.fedoraaccess.FedoraServer;
import cz.mzk.kramerius.fedoraaccess.exception.DatastreamNotFoundException;
import java.io.IOException;
import java.io.PrintStream;
import java.net.MalformedURLException;
import java.util.List;
import org.dom4j.Document;

/**
 *
 * @author Martin Řehánek <rehan at mzk.cz>
 */
public class MediaShelfConnector implements FedoraConnector {

    private final FedoraClient fedora;

    public MediaShelfConnector(FedoraServer fedoraServer) throws MalformedURLException {
        FedoraCredentials credentials = new FedoraCredentials(fedoraServer.getUrl(), fedoraServer.getLogin(), fedoraServer.getPassword());
        fedora = new FedoraClient(credentials);
    }

    public boolean addRelationship(String subject, String relationship, String object) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public List<String> findObjects(String termsString) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public Document getXmlDatastreamDissemination(String pid, DatastreamId dsId) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public String importFoxml(Document foxmlDoc, String logMessage) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public boolean objectExists(String objectPid) {
        FedoraClient.findObjects().pid();
//        PrintWriter x;
        //System.out.println("wtf");
//        PrintWriter o = new PrintWriter(System.err);
//        o.printf("%.4f", 123.5f);
//        o.close();
        return false;
    }

    public void printRepositoryInfo() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public void printRepositoryInfo(PrintStream out) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public void removeObject(String pid, String logMessage) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public boolean removeRelationship(String subject, String relationship, String object) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public boolean updateDatastreamInlineContent(String pid, DatastreamId dsId, Document content) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public String getRepositoryUrl() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public Document getObjectFoxml(String pid) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public boolean addRelationship(String subject, String relationship, String relationshipNsPrefix, String object) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public boolean removeRelationship(String subject, String relationship, String relationshipNsPrefix, String object) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public boolean removeRelationships(String subject, String relationship, String relationshipNsPrefix) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public boolean purgeDatastream(String pid, DatastreamId dsId, String logMessage) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public boolean addExternallyReferencedDatastream(String pid, DatastreamId dsId, String url, String mimeType, String label) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public boolean addManagedDatastreamByUrl(String pid, DatastreamId dsId, String url, String mimeType, String label) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public Document getDatastreamAsXml(String pid, DatastreamId dsId) throws DatastreamNotFoundException, IOException {
        throw new UnsupportedOperationException("Not supported yet.");
    }
}
